<?php
$emails = $this->emails;
?>
<div class="content-box">

    <div class="content-box-header">
        <h3>Delivery emails</h3>
        <ul class="content-box-tabs">
            <li><a class="default-tab" href="#tab1">Table</a></li>
        </ul>
        <div class="clear"></div>
    </div>
    <div class="content-box-content">
        <div class="tab-content default-tab" id="tab1">
            <a href="/admin/delivery/add" class="btn">Add email</a>
            <a href="/admin/delivery/import" class="btn">Import</a>

            <div class="row">
                <div class="span4">
                    <table class="table table-striped">
                        <thead>
                        <tr>
                            <th>#</th>
                            <th>Email</th>
                            <th></th>
                        </tr>
                        </thead>

                        <tbody>
                        <?php foreach ($emails as $key => $email): ?>
                        <tr>
                            <td><?php echo $key + 1 ?></td>
                            <td><?php echo $email['email'] ?></td>
                            <td>
                                <a href="/admin/delivery/edit/id/<?php echo $email['id'] ?>" class="btn btn-success">
                                    Edit
                                </a>
                                <a href="/admin/delivery/delete/id/<?php echo $email['id'] ?>"
                                   class="btn btn-danger delete">
                                    Delete
                                </a>
                            </td>
                        </tr>
                            <?php endforeach; ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>